<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>0127</title>
  <link rel="stylesheet" type="text/css" href="css/global_121024_uncompress.css">
  <script src="js/base_1.7.js" type="text/javascript"></script>
  <style type="text/css">
	.selector{
		height:23px;
		line-height:23px;
		position:relative;
		width:101px;
	}
	.selector .selector_input  {
		width:97px;
		height:23px;
		line-height:23px;
	}
	.selector .selector_list {
		max-height:200px;
		_height:200px;
		overflow-y:scroll;
		overflow-x:hidden;
		background:#f3f9fc;
		position:absolute;
		left:0;
		top:23px;
		border:solid 1px #57a8e4;
		cursor:auto;
		padding:1px;
	}
	.selector .selector_list {
		width: 100%;
		cursor: pointer;
	}
	.selector .selector_list .hover {
		background:#57a8e4;
	}
  </style>
</head>
<body>
<div class="selector" id="selector0">
	<div class="selector_wrap">
		<input autocomplete="off" maxlength="10" value="年" tabindex="12" class="selector_input">
	</div>
	<ul class="selector_list" style="display:none;"><li value="2013">2013年</li><li value="2012">2012年</li><li value="2011">2011年</li></ul>
</div>
<script type="text/javascript">
	$.fn.selectorssss = function(opt,callback) {
		var $this = $(this);
		var $input = $this.find(".selector_input");
		var $list = $this.find(".selector_list");
		var options = {
			action:"click",
			defaultValue:0,
			defaultIndex:2
		}
		opt = opt || {};
		opt = $.extend(options,opt);
		$input.bind(opt.action,function() {
			$list.show();
			return false;
		})
		$list.on("mouseover","li",function() {
			$(this).addClass("hover");
		}).on("mouseout","li",function() {
			$(this).removeClass("hover");
		}).on("click","li",function(){
			$input.val($(this).html());
		})
		$("body").on("click",function(){
			$list.hide();
		})
		if(callback) callback();
	};
	// $.fn.test = function() {};
	$("#selector0").selectorssss();
</script>
</body>
</html>